package org.jeecg.modules.lottery.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName("proc_lottery")
@ApiModel(value = "Lottery对象", description = "抽签记录")
@Table(name = "proc_lottery")
public class Lottery implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "采购方案ID")
    @NotBlank(message = "采购方案ID不能为空")
    @Column(name = "purchase_id")
    private String purchaseId;


    @ApiModelProperty(value = "公司名称")
    @NotBlank(message = "公司名称不能为空")
    @Column(name = "company_name")
    private String companyName;

    @ApiModelProperty(value = "供应商ID")
    @NotBlank(message = "供应商ID不能为空")
    @Column(name = "supplier_id")
    private String supplierId;

    @ApiModelProperty(value = "抽签状态：1-已抽签，2-放弃抽签")
    @Dict(dicCode = "lottery_status")
    @Column(name = "lottery_status")
    private String lotteryStatus ;

    @ApiModelProperty(value = "抽签时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "lottery_time")
    private Date lotteryTime;

    @ApiModelProperty(value = "备注")
    @Column(name = "remark")
    private String remark;

    @ApiModelProperty(value = "抽签操作人")
    @Column(name = "lottery_operator")
    private String lotteryOperator;

    @ApiModelProperty(value = "抽签轮次：1-首次抽签，2-二次补抽")
    @Column(name = "lottery_round")
    private Integer lotteryRound = 1;

    @ApiModelProperty(value = "创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty(value = "创建日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_time")
    private Date createTime;
}
